FROM node:16.20.0 as builder
WORKDIR /app
COPY package.json ./
RUN npm install -g pnpm
RUN pnpm config set registry https://registry.npm.taobao.org
RUN pnpm install

COPY docs ./docs
RUN ls
RUN pnpm docs:build

# 使用官方的 Nginx 镜像作为基础镜像
FROM nginx
# 将本地的前端项目文件复制到容器中的指定目录
COPY --from=builder /app/docs/.vuepress/dist /usr/share/nginx/html
# 暴露端口80
EXPOSE 80
